package com.djq.project.mq.consumer.routing;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RecvRouting {

    @RabbitListener(queues = RoutingConfig.DIRECT_EXCHANGE_QUEUE1)
    @RabbitHandler
    public void receive1(String in) {
        System.out.println(" ["+RoutingConfig.DIRECT_EXCHANGE_QUEUE1+"] Received '" + in + "'");
    }

    @RabbitListener(queues = RoutingConfig.DIRECT_EXCHANGE_QUEUE2)
    @RabbitHandler
    public void routing2(String in) {
        System.out.println(" ["+RoutingConfig.DIRECT_EXCHANGE_QUEUE2+"] Received '" + in + "'");
    }

}
